<template>
	<view class="container">
		<userInfo></userInfo>
		
		<view class="title">家庭经济状况登记表</view>
		<view class="bigTitle">共同家庭成员收入情况(元/年)</view>
		<view class="optionsBox">
			<view class="optionsDes">家庭城市人口数</view>
			<input @input="checkInput($event,'ruralPopulation')" placeholder-class="textareaTemp" type="number" v-if="!isOpen" v-model="obj.ruralPopulation" placeholder="请填写家庭城市人口数" class="optionsInput optionsInput2">
			<view class="optionsInput optionsInput2" v-else :class="!obj.ruralPopulation?'optionsInputTemp':''">
				{{obj.ruralPopulation?obj.ruralPopulation:'请填写家庭城市人口数'}}
			</view>
		</view>
		<view class="optionsBox">
			<view class="optionsDes">家庭农村人口数</view>
			<input @input="checkInput($event,'urbanPopulation')" placeholder-class="textareaTemp" type="number" v-if="!isOpen" v-model="obj.urbanPopulation" placeholder="请填写家庭农村人口数" class="optionsInput optionsInput2">
			<view class="optionsInput optionsInput2" v-else :class="!obj.urbanPopulation?'optionsInputTemp':''">
				{{obj.urbanPopulation?obj.urbanPopulation:'请填写家庭农村人口数'}}
			</view>
		</view>
		<view class="options">
			<view class="optionsLeft">户籍地址-县</view>
			<input placeholder-class="optionsRight4" class="optionsRight" v-if="!isOpen&&!areaShow" placeholder="请输入户籍地址-县" type="text" v-model="obj.residenceAddressCounty" />
			<view class="optionsRight optionsRight4" v-else>{{obj.residenceAddressCounty?obj.residenceAddressCounty:'请输入户籍地址-县'}}</view>
		</view>
		<view class="options">
			<view class="optionsLeft">户籍地址-街道</view>
			<input placeholder-class="optionsRight4" class="optionsRight" v-if="!isOpen&&!areaShow" placeholder="请输入户籍地址-街道" type="text" v-model="obj.residenceAddressStreet" />
			<view class="optionsRight optionsRight4" v-else>{{obj.residenceAddressStreet?obj.residenceAddressStreet:'请输入户籍地址-街道'}}</view>
		</view>
		<view class="options">
			<view class="optionsLeft">户籍地址社区</view>
			<input placeholder-class="optionsRight4" class="optionsRight" v-if="!isOpen&&!areaShow" placeholder="请输入户籍地址社区" type="text" v-model="obj.residenceAddressCommunity" />
			<view class="optionsRight optionsRight4" v-else>{{obj.residenceAddressCommunity?obj.residenceAddressCommunity:'请输入户籍地址社区'}}</view>
		</view>
		<picker mode="selector" range-key="dictLabel" :range="sheng" @change="shengChange">
			<view class="options">
				<view class="optionsLeft">居住地址-县</view>
				<view class="optionsRight">
					<view class="position" :style="!shengChoose.dictLabel?'color:#ccc;':''">{{shengChoose.dictLabel?shengChoose.dictLabel:'请选择'}}</view>
					<image class="positionIcon" src="/static/anfangDetail/position.png" mode=""></image>
				</view>
			</view>
		</picker>
		<picker mode="selector" range-key="dictLabel" :range="shiArr" @change="shiChange">
			<view class="options">
				<view class="optionsLeft">居住地址-街道</view>
				<view class="optionsRight">
					<view class="position" :style="!shiChoose.dictLabel?'color:#ccc;':''">{{shiChoose.dictLabel?shiChoose.dictLabel:'请选择'}}</view>
					<image class="positionIcon" src="/static/anfangDetail/position.png" mode=""></image>
				</view>
			</view>
		</picker>
		<picker mode="selector" range-key="dictLabel" :range="quArr" @change="quChange">
			<view class="options">
				<view class="optionsLeft">居住地址-社区</view>
				<view class="optionsRight">
					<view class="position" :style="!quChoose.dictLabel?'color:#ccc;':''">{{quChoose.dictLabel?quChoose.dictLabel:'请选择'}}</view>
					<image class="positionIcon" src="/static/anfangDetail/position.png" mode=""></image>
				</view>
			</view>
		</picker>
		<picker class="picker" :value="obj.housingValue" mode="selector" range-key="dictLabel" :range="zhufangfenlei" @change="zhufangfenleiChange">
			<view class="options">
				<view class="optionsLeft">房屋性质</view>
				<view class="optionsRight">
					<view class="position">{{zhufangfenleiObj[obj.housingValue]}}</view>
					<image class="positionIcon sanjiao" src="/static/kancha/sanjiao.png" mode=""></image>
				</view>
			</view>
		</picker>
		<picker class="picker" range-key="dictLabel" :value="obj.housingSource" mode="selector" :range="zulin" @change="zulinChange">
			<view class="options">
				<view class="optionsLeft">住房来源</view>
				<view class="optionsRight">
					<view class="position">{{zulinObj[obj.housingSource]}}</view>
					<image class="positionIcon sanjiao" src="/static/kancha/sanjiao.png" mode=""></image>
				</view>
			</view>
		</picker>
		<view class="optionsBox">
			<input @input="checkInput($event,'housingArea')" placeholder-class="textareaTemp" type="digit" v-if="!isOpen" v-model="obj.housingArea" placeholder="住房总面积" class="optionsInput">
			<view class="optionsInput" v-else :class="!obj.housingArea?'optionsInputTemp':''">
				{{obj.housingArea?obj.housingArea:'住房总面积'}}
			</view>
			<view class="optionsDes pingfangmi">房屋面积（m<text>2</text>）</view>
		</view>
		<view class="optionsBox">
			<input @input="checkInput($event,'housingNum')" placeholder-class="textareaTemp" type="digit" v-if="!isOpen" v-model="obj.housingNum" placeholder="住房总套数" class="optionsInput">
			<view class="optionsInput" v-else :class="!obj.housingNum?'optionsInputTemp':''">
				{{obj.housingNum?obj.housingNum:'住房总套数'}}
			</view>
			<view class="optionsDes">房屋数量（套）</view>
		</view>
		<view class="optionsBox">
			<input @input="checkInput($event,'householdIncome')" placeholder-class="textareaTemp" type="digit" v-if="!isOpen" v-model="obj.householdIncome" placeholder="家庭总收入" class="optionsInput">
			<view class="optionsInput" v-else :class="!obj.householdIncome?'optionsInputTemp':''">
				{{obj.householdIncome?obj.householdIncome:'家庭总收入'}}
			</view>
			<view class="optionsDes">家庭总收入（元/年）</view>
		</view>
		<!-- <view class="optionsBox">
			<input @input="checkInput($event,'communicationFee')" placeholder-class="textareaTemp" type="digit" v-if="!isOpen" v-model="obj.communicationFee" placeholder="年人均收入" class="optionsInput">
			<view class="optionsInput" v-else :class="!obj.communicationFee?'optionsInputTemp':''">
				{{obj.communicationFee?obj.communicationFee:'年人均收入'}}
			</view>
			<view class="optionsDes">元/年</view>
		</view> -->
		<view class="textAreaTitle">
			共同家庭成员收入情况
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea" v-if="!isOpen" v-model="obj.familyMembersLtati" placeholder="共同家庭成员收入情况" />
		<view class="textarea" v-else :class="!obj.familyMembersLtati?'textareaTemp':''">
			{{obj.familyMembersLtati?obj.familyMembersLtati:'共同家庭成员收入情况'}}
		</view>
		<view class="textAreaTitle">
			赡(抚、扶)养
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea" v-if="!isOpen" v-model="obj.dependency" placeholder="赡(抚、扶)养" />
		<view class="textarea" v-else :class="!obj.dependency?'textareaTemp':''">
			{{obj.dependency?obj.dependency:'赡(抚、扶)养'}}
		</view>
		<view class="textAreaTitle">
			装修情况
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea" v-if="!isOpen" v-model="obj.renovationCondition" placeholder="装修情况" />
		<view class="textarea" v-else :class="obj.renovationCondition?'textareaTemp':''">
			{{obj.renovationCondition?obj.renovationCondition:'装修情况'}}
		</view>
		<view class="textAreaTitle">
			家用电器
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea" v-if="!isOpen" v-model="obj.householdAppliances" placeholder="家用电器" />
		<view class="textarea" v-else :class="!obj.householdAppliances?'textareaTemp':''">
			{{obj.householdAppliances?obj.householdAppliances:'家用电器'}}
		</view>
		<view class="optionsBox">
			<view class="optionsDes">水、电、气支出金额（元/年）</view>
			<input @input="checkInput($event,'waterExpenditure')" placeholder-class="textareaTemp" type="digit" v-if="!isOpen" v-model="obj.waterExpenditure" placeholder="请填写金额" class="optionsInput optionsInput2">
			<view class="optionsInput optionsInput2" v-else :class="!obj.waterExpenditure?'optionsInputTemp':''">
				{{obj.waterExpenditure?obj.waterExpenditure:'请填写金额'}}
			</view>
		</view>
		<view class="optionsBox">
			<view class="optionsDes">家庭通讯费支出金额（元/年）</view>
			<input @input="checkInput($event,'communicationFee')" placeholder-class="textareaTemp" type="digit" v-if="!isOpen" v-model="obj.communicationFee" placeholder="请填写金额" class="optionsInput optionsInput2">
			<view class="optionsInput optionsInput2" v-else :class="!obj.communicationFee?'optionsInputTemp':''">
				{{obj.communicationFee?obj.communicationFee:'请填写金额'}}
			</view>
		</view>
		<view class="textAreaTitle">
			机动车、大型农机具等非生活必需品
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea2" v-if="!isOpen" v-model="obj.nonNecessities" placeholder="机动车、大型农机具等非生活必需品" />
		<view class="textarea2" v-else :class="!obj.nonNecessities?'textareaTemp':''">
			{{obj.nonNecessities?obj.nonNecessities:'机动车、大型农机具等非生活必需品'}}
		</view>
		<view class="textAreaTitle">
			子女择校就读情况
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea2" v-if="!isOpen" v-model="obj.childrenChooseSchool" placeholder="子女择校就读情况" />
		<view class="textarea2" v-else :class="!obj.childrenChooseSchool?'textareaTemp':''">
			{{obj.childrenChooseSchool?obj.childrenChooseSchool:'子女择校就读情况'}}
		</view>
		<view class="textAreaTitle">
			饲养高档宠物、购置贵重首饰或其他贵重品
		</view>
		<textarea class="textarea2" v-if="!isOpen" v-model="obj.valuables" placeholder="饲养高档宠物、购置贵重首饰或其他贵重品" />
		<view class="textarea2" v-else :class="!obj.valuables?'textareaTemp':''">
			{{obj.valuables?obj.valuables:'饲养高档宠物、购置贵重首饰或其他贵重品'}}
		</view>
		<view class="textAreaTitle">
			其他不能享受最低生活保障的情形
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea2" v-if="!isOpen" v-model="obj.otherSituationsTces" placeholder="其他不能享受最低生活保障的情形" />
		<view class="textarea2" v-else :class="!obj.otherSituationsTces?'textareaTemp':''">
			{{obj.otherSituationsTces?obj.otherSituationsTces:'其他不能享受最低生活保障的情形'}}
		</view>
		<view class="textAreaTitle">
			家庭困难综合情况
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea2" v-if="!isOpen" v-model="obj.comprehensiveSofd" placeholder="家庭困难综合情况" />
		<view class="textarea2" v-else :class="!obj.comprehensiveSofd?'textareaTemp':''">
			{{obj.comprehensiveSofd?obj.comprehensiveSofd:'家庭困难综合情况'}}
		</view>
		<view class="textAreaTitle">
			结论
		</view>
		<textarea placeholder-class="textareaTemp" class="textarea2" v-if="!isOpen" v-model="jielun" placeholder="请填写结论" />
		<view class="textarea2" v-else :class="!jielun?'textareaTemp':''">
			{{jielun?jielun:'请填写结论'}}
		</view>
		<view class="optionsBox2">
			<view class="options2Title">
				调查结果是否与申请材料一致
			</view>
			<view class="optionsSelectBox">
				<view class="optionsSelectBoxIn" @click="choose(index)" v-for="(item,index) in chooseList" :key="index">
					<image class="chooseIcon" src="/static/kancha/choose.png" v-if="chooseIndex == index" mode=""></image>
					<image class="chooseIcon" src="/static/kancha/nochoose.png" v-else mode=""></image>
					<view class="chooseIconDes">
						{{item}}
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="button1" @click="save">
			提交
		</view> -->
		<view class="button" @click="save(true)">
			提交
		</view>
		<view class="zhenchayuan">侦查员——{{user.nickName?user.nickName:user.userName}}</view>
		<view class="bottom"></view>
		<otherList @openChange="isOpenChange" :isShowAll="true"/>
	</view>
</template>

<script>
	import otherList from '@/pages/components/otherInfoList.vue'
	import userInfo from '@/pages/components/userInfo.vue'
	export default {
		components:{
			otherList,userInfo
		},
		data(){
			return {
				isOpen:false,
				chooseIndex:0,
				chooseList:['与材料一致','与材料不一致'],
				obj:{},
				user:{},
				sheng:[],
				shi:[],
				qu:[],
				shengArr:[],
				shiArr:[],
				quArr:[],
				shengChoose:{},
				shiChoose:{},
				quChoose:{},
				zhufangfenlei:['商品房','经济适用房','福利房','拆迁安置','自建住房','其他'],
				zhufangfenleiObj:{},
				chanquan:['产权','无产权'],
				chanquanObj:{},
				yongtu:['自用','商住','出租'],
				yongtuObj:{},
				zulin:['租赁私有','租赁公有','廉租房','其他'],
				zulinObj:{},
				jiegou:['土木','砖木','砖混','框架','其他'],
				jiegouObj:{},
				jielun:'无'
			}
		},
		computed:{
			
		},
		onLoad() {
			this.user = uni.getStorageSync('user')
			this.getDetail()
		},
		methods:{
			changeZhaiquan(index){
				this.zhaiquan = index
			},
			zhufangfenleiChange(e){
				this.obj.housingValue = this.zhufangfenlei[e.detail.value].dictValue
			},
			chanquanChange(e){
				this.obj.housingProperty = e.detail.value
			},
			yongtuChange(e){
				this.obj.housingUse = this.yongtu[e.detail.value].dictValue
			},
			zulinChange(e){
				this.obj.housingSource = this.zulin[e.detail.value].dictValue
			},
			jiegouChange(e){
				this.obj.houseStructure = this.jiegou[e.detail.value].dictValue
			},
			// 省选择
			shengChange(e){
				if(this.shengChoose.hasOwnProperty('dictValue')){
					if(this.shengChoose.dictValue == this.sheng[e.detail.value].dictValue){
						return
					}
				}
				this.shengChoose = this.sheng[e.detail.value]
				
				this.shiArr = this.shi.filter(item=>{
					return item.dictValue.slice(0,6) == this.shengChoose.dictValue
				})
				this.shiChoose = {}
				this.quChoose = {}
			},
			// 市选择
			shiChange(e){
				if(this.shiChoose.hasOwnProperty('dictValue')){
					if(this.shiChoose.dictValue == this.shiArr[e.detail.value].dictValue){
						return
					}
				}
				this.shiChoose = this.shiArr[e.detail.value]
				this.quArr = this.qu.filter(item=>{
					return item.dictValue.slice(0,9) == this.shiChoose.dictValue
				})
				this.quChoose = {}
			},
			// 区选择
			quChange(e){
				this.quChoose = this.quArr[e.detail.value]
			},
			checkInput(e,index) {
				setTimeout(()=>{
					this.obj[index] = this.$verifyMoney(e.detail.value);
					this.obj = JSON.parse(JSON.stringify(this.obj))
				},0)
			},
			// 表单验证
			verifyData(){
				// 验证现金
				let obj = this.obj
				// 验证人口
				if(this.$verifyEmpty(obj.urbanPopulation)){
					return {
						status:false,
						title:'家庭城市人口数不能为空'
					}
				}
				// 验证人口
				if(this.$verifyEmpty(obj.ruralPopulation)){
					return {
						status:false,
						title:'家庭城农村口数不能为空'
					}
				}
				// 验证户籍地址县
				if(this.$verifyEmpty(obj.residenceAddressCounty)){
					return {
						status:false,
						title:'户籍地址-县不能为空'
					}
				}
				// 验证户籍地址街道
				if(this.$verifyEmpty(obj.residenceAddressStreet)){
					return {
						status:false,
						title:'户籍地址-街道不能为空'
					}
				}
				// 验证户籍地址社区
				if(this.$verifyEmpty(obj.residenceAddressCommunity)){
					return {
						status:false,
						title:'户籍地址-社区不能为空'
					}
				}
				// 验证居住地址县
				if(Object.keys(this.shengChoose).length == 0){
					return {
						status:false,
						title:'居住地址-县不能为空'
					}
				}
				// 验证居住地址街道
				if(Object.keys(this.shiChoose).length == 0){
					return {
						status:false,
						title:'居住地址-街道不能为空'
					}
				}
				// 验证居住地址社区
				if(Object.keys(this.quChoose).length == 0){
					return {
						status:false,
						title:'居住地址-社区不能为空'
					}
				}
				// 房屋面积
				if(this.$verifyEmpty(obj.housingArea)){
					return {
						title:'房屋面积不能为空',
						status:false
					}
				}
				// 房屋数量
				if(this.$verifyEmpty(obj.housingNum)){
					return {
						title:'房屋数量不能为空',
						status:false
					}
				}
				// 家庭总收入
				if(this.$verifyEmpty(obj.householdIncome)){
					return {
						title:'家庭总收入不能为空',
						status:false
					}
				}
				// 验证共同家庭成员收入情况
				if(this.$verifyEmpty(obj.familyMembersLtati)){
					return {
						title:'共同家庭成员收入情况不能为空',
						status:false
					}
				}
				// 验证赡养情况
				if(this.$verifyEmpty(obj.dependency)){
					return {
						title:'赡养情况不能为空',
						status:false
					}
				}
				// 验证装修情况
				if(this.$verifyEmpty(obj.renovationCondition)){
					return {
						title:'装修情况不能为空',
						status:false
					}
				}
				// 验证家用电器情况
				if(this.$verifyEmpty(obj.householdAppliances)){
					return {
						title:'家用电器不能为空',
						status:false
					}
				}
				// 验证水、电、气支出金额
				if(this.$verifyEmpty(obj.waterExpenditure)){
					return {
						title:'水、电、气支出金额不能为空',
						status:false
					}
				}
				// 验证家庭通讯费支出金额
				if(this.$verifyEmpty(obj.communicationFee)){
					return {
						title:'家庭通讯费支出金额不能为空',
						status:false
					}
				}
				// 验证机动车、大型农机具等非生活必需品
				if(this.$verifyEmpty(obj.nonNecessities)){
					return {
						title:'机动车、大型农机具等非生活必需品不能为空',
						status:false
					}
				}
				// 验证子女择校就读情况
				if(this.$verifyEmpty(obj.childrenChooseSchool)){
					return {
						title:'子女择校就读情况不能为空',
						status:false
					}
				}
				// 验证饲养高档宠物、购置贵重首饰或其他贵重品
				if(this.$verifyEmpty(obj.valuables)){
					return {
						title:'饲养高档宠物、购置贵重首饰或其他贵重品不能为空',
						status:false
					}
				}
				// 验证其他不能享受最低生活保障的情形
				if(this.$verifyEmpty(obj.otherSituationsTces)){
					return {
						title:'其他不能享受最低生活保障的情形不能为空',
						status:false
					}
				}
				// 验证家庭困难综合情况
				if(this.$verifyEmpty(obj.comprehensiveSofd)){
					return {
						title:'家庭困难综合情况不能为空',
						status:false
					}
				}
				// 验证家庭困难综合情况
				if(this.$verifyEmpty(this.jielun)){
					return {
						title:'结论不能为空',
						status:false
					}
				}
				return {
					title:'验证通过',
					status:true
				}
			},
			// 获取详情
			async getDetail(){
				uni.showLoading({
					title:'请稍等...'
				})
				let res = await this.$get('/app/bus/indexSurvey?guaranteeNumber='+uni.getStorageSync('guaranteeNumber')+'&taskId='+uni.getStorageSync('taskId'),{})
				if(res.code == 200){
					let obj = res.data[0]
					Object.keys(obj).forEach(item=>{
						if(obj[item] === null){
							obj[item] = ""
						}
					})
					if(obj.whetherTheSracwtam == ""){
						obj.whetherTheSracwtam = 0
					}
					obj.familyMembersLtati= obj.familyMembersLtati||'无'
					obj.dependency= obj.dependency||'无'
					obj.renovationCondition= obj.renovationCondition||'无'
					obj.householdAppliances= obj.householdAppliances||'无'
					obj.nonNecessities= obj.nonNecessities||'无'
					obj.childrenChooseSchool= obj.childrenChooseSchool||'无'
					obj.valuables= obj.valuables||'无'
					obj.otherSituationsTces= obj.otherSituationsTces||'无'
					obj.comprehensiveSofd= obj.comprehensiveSofd||'无'
					obj.housingArea = obj.housingArea||0 // 建筑面积
					obj.urbanPopulation = obj.urbanPopulation||0 // 城市总人口
					obj.ruralPopulation = obj.ruralPopulation||0 // 农村总人口
					obj.housingArea = obj.housingArea||0 // 房屋面积
					obj.housingNum = obj.housingNum||0 // 房屋套数
					obj.householdIncome = obj.householdIncome||0 // 家庭总收入
					// obj.familyMembersLtati = obj.familyMembersLtati||0 // 年人均收入
					obj.housingValue = obj.housingValue||0 // 性质
					obj.housingSource = obj.housingSource||0 // 来源
					obj.waterExpenditure = obj.waterExpenditure||0 // 水电
					obj.communicationFee = obj.communicationFee||0 // 通讯
					this.chooseIndex = obj.whetherTheSracwtam
					this.obj = res.data[0]
				}
				// 获取住房类型
				let zhufangfenleiArr = await this.$get('/app/bus/dictType?dictType=own_housing_types',{})
				if(zhufangfenleiArr.code == 200){
					this.zhufangfenlei = zhufangfenleiArr.data
					this.zhufangfenlei.forEach(item=>{
						this.zhufangfenleiObj[item.dictValue]=item.dictLabel
					})
				}
				
				// 获取租赁
				let zulinArr = await this.$get('/app/bus/dictType?dictType=housing_lease_type',{})
				if(zulinArr.code == 200){
					this.zulin = zulinArr.data
					this.zulin.forEach(item=>{
						this.zulinObj[item.dictValue]=item.dictLabel
					})
				}
				// 获取结构
				let jiegouArr = await this.$get('/app/bus/dictType?dictType=housing_structure',{})
				if(jiegouArr.code == 200){
					this.jiegou = jiegouArr.data
					this.jiegou.forEach(item=>{
						this.jiegouObj[item.dictValue]=item.dictLabel
					})
				}
				// 获取房屋用途
				let yongtuArr = await this.$get('/app/bus/dictType?dictType=house_use',{})
				if(yongtuArr.code == 200){
					this.yongtu = yongtuArr.data
					this.yongtu.forEach(item=>{
						this.yongtuObj[item.dictValue]=item.dictLabel
					})
				}
				// 获取政治面貌数组
				let shengArr = await this.$get('/app/bus/dictType?dictType=area_x',{})
				if(shengArr.code == 200){
					this.sheng = shengArr.data.filter(item=>{
						return item.dictLabel == '乾安县'
					})
				}
				let shiArr = await this.$get('/app/bus/dictType?dictType=area_j',{})
				if(shiArr.code == 200){
					this.shi = shiArr.data
					this.shiArr = this.shi.filter(item=>{
						return item.dictValue.slice(0,6) == this.sheng[0].dictValue
					})
				}
				let quArr = await this.$get('/app/bus/dictType?dictType=area_s',{})
				if(quArr.code == 200){
					this.qu = quArr.data
					this.quArr = this.qu.filter(item=>{
						return item.dictValue.slice(0,8) == this.shi[0].dictValue
					})
				}
				this.shengChange({detail:{value:0}})
				this.shiChange({detail:{value:0}})
				this.quChange({detail:{value:0}})
				
				if(this.obj.residentialAddressStreet){
					this.shiArr = this.shi.filter(item=>{
						return item.dictValue.slice(0,6) == this.shengChoose.dictValue
					})
					this.shiArr.forEach((item,index)=>{
						if(item.dictValue == this.obj.residentialAddressStreet){
							this.shiChange({detail:{value:index}})
						}
					})
					if(this.obj.residentialAddressCommunity){
						this.quArr.forEach((item,index)=>{
							if(item.dictValue == this.obj.residentialAddressCommunity){
								this.quChange({detail:{value:index}})
							}
						})
					} else {
						this.quChange({detail:{value:0}})
					}
				}
				uni.hideLoading()
			},
			// 选择事件
			choose(index){
				this.chooseIndex = index
			},
			// 基本信息开关
			isOpenChange(e){
				this.isOpen = e
				if(e){
					this.save(false)
				}
			},
			async save(isLink){
				let result = this.verifyData()
				if(isLink){
					if(!result.status){
						uni.showModal({
							content: result.title,
							showCancel: false,
							confirmText: '确定'
						});
						return
					}
				}
				uni.showLoading({
					title:'请稍等...'
				})
				let data = JSON.parse(JSON.stringify(this.obj))
				data.residentialAddressCounty = this.shengChoose.dictValue?this.shengChoose.dictValue:''
				data.residentialAddressStreet = this.shiChoose.dictValue?this.shiChoose.dictValue:''
				data.residentialAddressCommunity = this.quChoose.dictValue?this.quChoose.dictValue:''
				data.whetherTheSracwtam = this.chooseIndex
				data.guaranteeNumber = uni.getStorageSync('guaranteeNumber')
				let res = await this.$post('/app/bus/updateSurvey',data,false)
				let twoRes = await this.$post('/app/bus/jielun',{
					taskId:uni.getStorageSync('taskId').data,
					jielun:this.jielun
				},false)
				if(res.code == 200&&twoRes.code == 200){
					if(isLink){
						uni.hideLoading()
						uni.showModal({
							content: '一旦提交信息将无法修改，是否确认提交？',
							showCancel: true,
							cancelText: '取消',
							confirmText: '确认',
							success: async res => {
								if(res.confirm){
									uni.showLoading({
										title:'请稍等...'
									})
								
									let changeStatus = await this.$get('/app/bus/taskStatusText/'+uni.getStorageSync('taskId'))
									if(changeStatus.code  == 200){
										uni.navigateBack({
											
										})
									}
									uni.hideLoading()
								}
							}
						});
					} else {
						// uni.showToast({
						// 	title: '信息修改成功',
						// 	duration:2000
						// });
					}
				}
				uni.hideLoading()
			},
			link(){
				wx.navigateBack()
			}
		}
	}
</script>

<style scoped>
	.textAreaTitle{
		padding: 20rpx 0 0 40rpx;
	}
	.pingfangmi{
		/* color: #ccc; */
	}
	.pingfangmi text{
		display: inline-block;
		font-size: 18rpx;
		/* color:#ccc; */
		position: relative;
		transform: translateY(-10rpx);
	}
	.title{
		font-size:26rpx;
		color:#fa5245;
		line-height:1;
		text-align:center;
		padding-bottom:20rpx;
		padding-top:50rpx;
	}
	.bigTitle{
		font-size:34rpx;
		text-align:center;
		margin-top:30rpx;
		margin-bottom: 60rpx;
	}
	.textarea{
		width: 680rpx;
		margin: 0 auto;
		padding: 20rpx;
		height: 290rpx;
		font-size: 28rpx;
		box-sizing: border-box;
		border-radius: 10rpx;
		border:1rpx solid #ccc;
		margin-top: 30rpx;
	}
	.textarea2{
		width: 680rpx;
		margin: 0 auto;
		padding: 20rpx;
		height: 160rpx;
		font-size: 28rpx;
		box-sizing: border-box;
		border-radius: 10rpx;
		border:1rpx solid #ccc;
		margin-top: 30rpx;
	}
	.optionsBox{
		width: 680rpx;
		border-radius: 10rpx;
		border:1rpx solid #ccc;
		margin:  0 auto;
		margin-top: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 20rpx;
		height: 90rpx;
	}
	.optionsBox2{
		width: 680rpx;
		border-radius: 10rpx;
		border:1rpx solid #ccc;
		margin:  0 auto;
		margin-top: 30rpx;
		padding: 20rpx;
	}
	.options2Title{
		font-size: 28rpx;
		color: #ccc;
	}
	.optionsSelectBox{
		display: flex;
		align-items: center;
		margin-top: 20rpx;
	}
	.optionsSelectBoxIn{
		flex: 1;
		display: flex;
		align-items: center;
	}
	.chooseIcon{
		width: 28rpx;
		height: 27rpx;
		margin-right: 30rpx;
	}
	.optionsInput{
		font-size: 28rpx;
		flex: 1;
	}
	.optionsDes{
		font-size: 28rpx;
	}
	.button1{
		width:570rpx;
		line-height:84rpx;
		text-align:center;
		margin:0 auto;
		margin-top:50rpx;
		border-radius:6rpx;
		background:#656668;
		font-size:28rpx;
		color:white;
	}
	.button{
		width:570rpx;
		line-height:84rpx;
		text-align:center;
		margin:0 auto;
		margin-top:50rpx;
		border-radius:6rpx;
		background:linear-gradient(90deg,#fa5444,#ff988f);
		font-size:28rpx;
		color:white;
		
	}
	.zhenchayuan{
		font-size: 24rpx;
		color:#ccc;
		margin-top: 20rpx;
		text-align: center;
	}
	.bottom{
		height:160rpx;
	}
	.topTitleBox{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 40rpx;
		height: 90rpx;
	}
	.listTiteBox {
		position: relative;
	}
	
	.listTitleBackground {
		height: 16rpx;
		width: 120rpx;
		position: absolute;
		bottom: 0;
		right: 0;
		background: linear-gradient(-90deg, #ffd356, #ffffff)
	}
	.listTitle{
		font-size:38rpx;
		position: relative;
	}
	.right {
		width: 34rpx;
		height: 34rpx;
		position: relative;
		transition: all 0.3s;
	}
	.childrenBox{
		width: 600rpx;
		margin: 0 auto;
		height: 0;
		position: relative;
		transition: all 0.3s;
		overflow: hidden;
	}
	.childrenOptionsBox{
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		padding: 20rpx 0;
	}
	.childrenOptionsTitle{
		font-size: 26rpx;
		line-height: 30rpx;
		color: #ccc;
	}
	.childrenOptionsDes{
		font-size: 26rpx;
		line-height: 30rpx;
		width: 450rpx;
		text-align: right;
	}
	.rightOpen{
		transform: rotate(90deg);
	}
	.line1{
		height: 20rpx;
		background-color: #efefef;
	}
	.otherInfo{
		width: 200rpx;
		line-height:70rpx;
		text-align: center;
		font-size: 24rpx;
		color:white;
		border-radius: 35rpx 0 0 35rpx;
		background-color: #3b3b3b;
		position: fixed;
		right: 0;
		top:460rpx;
		font-family: '黑体';
	}
	.optionsInputTemp{
		color: #ccc;
	}
	.textareaTemp{
		color: #ccc;
	}
	.options {
		width: 680rpx;
		border-radius: 10rpx;
		border:1rpx solid #ccc;
		margin:  0 auto;
		margin-top: 30rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 20rpx;
		height: 90rpx;
	}
	
	.optionsLeft {
		font-size: 30rpx;
		/* color: #ccc; */
	}
	
	.optionsBottomTitle {
		font-size: 30rpx;
		color: #ccc;
	}
	
	.optionsRight {
		display: flex;
		align-items: center;
		font-size: 30rpx;
		text-align: right;
	}
	.optionsRight4{
		color: #ccc;
	}
	.position {
		max-width: 360rpx;
	}
	
	.optionsRight1 {
		max-width: 400rpx;
		height: 40rpx;
		color: #ccc;
		padding: 0;
		margin: 0;
	}
	
	.positionIcon {
		width: 27rpx;
		height: 38rpx;
		margin-left: 25rpx;
	}
	.optionsInput2{
		text-align: right;
	}
	.sanjiao {
		width: 23rpx;
		height: 18rpx;
		margin-left: 20rpx;
	}
</style>
